home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Know Your Baseball - The Greatest Player Resource
/
Know Your Baseball - Greatest Player.iso
/
Baseball
/
Director
/
KTGCST.CST
/
00097_Script_ButtonsObject
< prev
next >
Wrap
Text File
|
1998-09-21
|
2KB
|
91 lines
property LastSelected,NowOn
on new me,which
set NowOn = []
set lastSelected = []
return me
end
--which = sprite channel
-- type-- annimation behavoiur
--1 no mousedown screen state
--2 mousedown screen state
-- action -- handler name or go to X
-- clickit = puppetsound that you wantplayed for button click
global gButtonState
on button me, which,type,action,MB,Clickit
if voidp(MB) then put mousecast() into MB
if voidp(Clickit) = 0 then
puppetsound 0
puppetsound Clickit
updatestage
end if
puppetsprite which,1
-- behave according to type required
case type of
1: -- non sticky button does action on mousedown
losepop(window "pop")
repeat while stilldown()=1
if mousecast()= MB then
set the membernum of sprite which to MB+1
set the blend of sprite which = 100
updatestage
next repeat
end if
--return to normal whem off button
if (mousecast() <>MB+1)then
set the membernum of sprite which to MB
set the blend of sprite which = 0
end if
updatestage
if rollOver(which) then
do action
end if
end repeat
set the membernum of sprite which to MB
2:
-- threestate button that sticks
set clicked = getat(gbuttonstate,which)
if clicked = 0 then
repeat while stilldown()=1
if mousecast()= MB then
set the membernum of sprite which = MB+1
set the blend of sprite which = 100
updatestage
end if
--return to normal whem off button
if (mousecast() <>MB+1)then
set the member of sprite which to MB
set the blend of sprite which = 0
updatestage
end if
end repeat
else
puppetsound 0
losepop(window "pop")
setat(gbuttonstate,clickon(),0)
set the membernum of sprite which = MB
updatestage
exit
end if
if rollOver(which) then
puppetsound 0
set the membernum of sprite which = MB+1
setat(gbuttonstate,which,2)
updatestage
do action
end if
end case
end